function twoDigits(num)
{
	return num<10 ? '0'+num : num;
}

function nowClicked(e)
{
	var d = new Date();
	var date = d.getFullYear()+'-'+twoDigits(d.getMonth()+1)+'-'+twoDigits(d.getDate());
	var time = twoDigits(d.getHours())+':'+twoDigits(d.getMinutes());

	$(this).data('datepicker').val(date).change();
	$(this).data('timepicker').val(time).change();
	return false;
}

function neverClicked(e)
{
	$(this).data('datepicker').val('');
	$(this).data('timepicker').val('');
	return false;
}

$(document).ready(function(){
	$("p.date").each(function(){
		var now = $('<span class="now"></span>');
		now.data('datepicker', $('.datepicker', this));
		now.data('timepicker', $('.timepicker', this));
		now.click(nowClicked)
		$(this).append(now);
		
		var never = $('<span class="never"></span>');
		never.data('datepicker', $('.datepicker', this));
		never.data('timepicker', $('.timepicker', this));
		never.click(neverClicked)
		$(this).append(never);
	});
});